package cn.gmcx.lazy.izze.pojo;

import cn.gmcx.lazy.izze.enums.GenderMeun;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer id;


    @NotBlank(message = "当前用户名为空")
    private String username;


    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;


    @Email(message = "邮箱格式不正确")
    private String email;

    private GenderMeun gender;
    private String sign;
    private String avatar;
    private String izzeCode;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String location;
    private String school;


    private Integer concern;


    private Integer fans;


    private Integer praise;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;


    @NotNull(message = "当前密码为空")
    @Size(min = 6, max = 20, message = "密码验证错误")
    private String password;

}
